import React  from 'react';
import SimpleUtilPage from './SimpleUtilPage';

const struct ={
  url : '/fineReport/fineReportSqlScript2SqlWithOngl',
  demoValue: 'SELECT\n' +
    '\trownum,\n' +
    '\tgyzccydw,\n' +
    '\tyz,\n' +
    '\tjz,\n' +
    '\tjyyy,\n' +
    '\tpzjgmc,\n' +
    '\tpzjgcj,\n' +
    '\txmpzsj,\n' +
    '\tgyzcjylx,\n' +
    '\tjyfs,\n' +
    '\tjydjyj,\n' +
    '\tjzr,\n' +
    '\tpgbgbasjjd,\n' +
    '\tjydjje,\n' +
    '\tjyzt,\n' +
    '\txmwczzsj,\n' +
    '\tzbbh,\n' +
    '\tcqjyjgmc,\n' +
    '\tjyjdqk,\n' +
    '\tcjdw,\n' +
    '\tcjdwxz,\n' +
    '\tfgkxysfwtyjczqynbxyxw,\n' +
    '\tcjje,\n' +
    '\tbndfse,\n' +
    '\tbz,\n' +
    '\tgyzcjyxmmc,\n' +
    '\tMODEDATACREATEDATE,\n' +
    '\tMODEDATACREATETIME\n' +
    'FROM\n' +
    '\tuf_gyzcjy\n' +
    'WHERE\n' +
    '  -- 去掉gyzcjyxmmc重复的, 只有创建时间最大的那条\n' +
    '\tid IN (\n' +
    '\tSELECT\n' +
    '\t\tid\n' +
    '\tFROM\n' +
    '\t\t( SELECT id, row_number ( ) over ( partition BY gyzcjyxmmc ORDER BY MODEDATACREATEDATE DESC, MODEDATACREATEDATE DESC ) rn FROM uf_gyzcjy ) t\n' +
    '\tWHERE\n' +
    '\t\tt.rn <= 1\n' +
    '\t)\n' +
    '\tAND shzt = 2\n' +
    '\t${if(len(xmpzStart)>0," AND TO_DATE( xmpzsj, \'yyyy-mm-dd\' ) >= TO_DATE( \'" + xmpzStart + "\', \'yyyy-mm-dd\' )","")}\n' +
    '\t${if(len(xmpzEnd)>0," AND TO_DATE( xmpzsj, \'yyyy-mm-dd\' ) <= TO_DATE( \'" + xmpzEnd + "\', \'yyyy-mm-dd\' ) ","")}\n' +
    '     ${if(len(xmwczzStart)>0," \tAND TO_DATE( xmwczzsj, \'yyyy-mm-dd\' ) >= TO_DATE( \'" + xmwczzStart + "\', \'yyyy-mm-dd\' )","")}\n' +
    '\t${if(len(xmwczzEnd)>0," AND TO_DATE( xmwczzsj, \'yyyy-mm-dd\' ) <= TO_DATE( \'" + xmwczzEnd + "\', \'yyyy-mm-dd\' ) ","")}\n' +
    '\t${if(len(tpsjStart)>0," AND TO_DATE( MODEDATACREATEDATE, \'yyyy-mm-dd\' ) >= TO_DATE( \'" + tpsjStart + "\', \'yyyy-mm-dd\' )","")}\n' +
    '${if(len(tbsjEnd)>0," \tAND TO_DATE( MODEDATACREATEDATE, \'yyyy-mm-dd\' ) <= TO_DATE( \'" + tbsjEnd + "\', \'yyyy-mm-dd\' ) ","")}\n' +
    '${if(len(tbdws)>0," AND tbdw IN (" + tbdws + ")","")}'
}
function FineReportSqlScript2SqlWithOngl(){
  return <SimpleUtilPage struct={struct}/>
}

export default FineReportSqlScript2SqlWithOngl;
